package com.m3958.firstgwt.server.accesschecker;

import com.m3958.firstgwt.server.model.DataTemplate;
import com.m3958.firstgwt.server.model.WebSite;
import com.m3958.firstgwt.server.types.ObjectOperation;
import com.m3958.firstgwt.shared.type.CommonField;
import com.m3958.firstgwt.shared.type.SmartConstants;





public class DataTemplateChecker extends BaseChecker<DataTemplate> {

	@Override
	protected boolean canAdd() {
		return hasObjectPerms(WebSite.class.getSimpleName(), getSiteIdFromPara(), ObjectOperation.ADD_CONTENT);
	}

	@Override
	protected boolean canCustom() {
		return false;
	}

	@Override
	protected boolean canFetch() {
		if(reqPs.getIdValue(CommonField.SITE_ID.getValue()) == SmartConstants.NONE_EXIST_MODEL_ID){
			return false;
		}else{
			return true;
		}
	}

	@Override
	protected boolean canMyRpc() {
		return false;
	}

	@Override
	protected boolean canRemove() {
		return hasObjectPerms(WebSite.class.getSimpleName(), getSiteIdFromPara(), ObjectOperation.REMOVE_CONTENT);
	}

	@Override
	protected boolean canUpdate() {
		return hasObjectPerms(WebSite.class.getSimpleName(), getSiteIdFromPara(), ObjectOperation.UPDATE_CONTENT);
	}

}
